package com.vaadin;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class ConfigurationDataBase {
	
	final String url = "jdbc:mysql://locahost:3306/";
	final String name = "forecast";
	final String driver = "com.mysql.jdbc.Driver";
	final String userName = "root";
	final String password = "root";
	
	Connection conn = null;
	
	void newConnection() {
		
		try {
			Class.forName(driver).newInstance();
			this.conn = DriverManager.getConnection(url + name, userName, password);
			
			if (!conn.isClosed())
				System.out.println("DataBase connection working using TCP/IP...");
			
		} catch (Exception e) {
			System.err.println("Exception: " + e.getMessage());
		}
	}
}
